package com.wnagyanli.feignconsumer.Controller;

import com.wnagyanli.feignconsumer.entity.user;
import com.wnagyanli.feignconsumer.service.helloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class feignController {

    @Autowired
    private helloService helloService1;
    @RequestMapping("/feign/consumer")
    public String feignHello(){
     return  helloService1.hello();
    };

    @PostMapping("/feign/user")
    public user feignUser(){
        user userPost=new user();
        userPost.setAge(23);
        userPost.setName("王五");
        userPost.setPhone("2132453");
        user users = helloService1.postUser(userPost);
        return users;
    };
}
